#include <bits/stdc++.h>

using namespace std;

int a[100010];
int b[100010];
int c[100010];
multiset<int> s;

int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    int n; cin >> n;
    for (int i = 1; i <= n; i ++ ) cin >> a[i];
    sort(a + 1, a + n + 1); int tot = 0;
    for (int i = 1; i <= n; i ++ )
        if (b[a[i]] == 0) b[a[i]] = ++ tot;
    for (int i = 1; i <= n; i ++ ) c[b[a[i]]] ++ ;
    for (int i = 1; i <= n; i ++ )
    {
        int cnt = 0;
        while (s.size() > 0 && *s.begin() < i && cnt + 1 <= c[i])
            s.erase(s.begin()), cnt ++ ;
        for (int j = 1; j <= c[i]; j ++ ) s.insert(i);
    }
    cout << s.size();
    return 0;
}
